//
//  HYOUBaseTableView.m
//  BestGift
//
//  Created by dllo on 15/12/29.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "HYOUBaseTableView.h"

@implementation HYOUBaseTableView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
    self = [super initWithFrame:frame style:style];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];

        
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
        
        NSString *states = [[NSUserDefaults standardUserDefaults] objectForKey:@"night"];
        if ([states isEqualToString:@"yes"]) {
            self.backgroundColor = NIGHT_COLOR;
            
        }
    }
    return self;
}
-(void)changeColor:(NSNotification *)notification{
    UIColor *color = [notification object];
    self.backgroundColor = color;
}
@end
